<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 400px;
      height: 400px;
      background-color: green;
      display: flow-root;
    }

    .inner {
      margin-top: 100px;
      height: 100px;
      width: 100px;
      background-color: pink;
    }

    /* 如果父元素没有 border 和 padding，给其子元素添加的 margin-top 样式会作用于父元素上 */
  </style>
</head>

<body>
  <div class="box">
    <div class="inner"></div>
  </div>
</body>

</html>